<%@page import="com.xxb.entity.Product"%>
<%@page import="com.xxb.dao.TypeDao"%>
<%@page import="com.xxb.entity.Type"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../base.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Simpla Admin</title>
<link rel="stylesheet" type="text/css" href="<%=basePath %>/images/index.css" media="all"/>
 <script type="text/javascript">
  	function reldel(id){
  		if(confirm("真的要删除吗？")){
  			window.location.href = "l_deleteproduct.jsp?id="+id;
  		}
  	}
 </script>
</head>
<body>
		<%@ include file="left.jsp" %>
		<!-- 右边 -->
		<img style="margin-left:300px" src="<%=basePath %>/images/logo.jpg"/>
		<div id="main-content"> 
			
			<div class="content-box">
				
				<div class="content-box-header">
					
					<h3 style="cursor: s-resize;">商品列表</h3>
					<div style="float:right;margin-top:5px">
						<a href="l_to_addproduct.jsp"><img src="<%=basePath %>/images/add.png"/></a>
					</div>
					<!--
					<ul class="content-box-tabs">
						<li><a href="#tab1" class="default-tab current">Table</a></li> 
						<li><a href="#tab2">Forms</a></li>
					</ul>
					-->
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
					
					<div style="display: block;" class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
						
						<div class="notification attention png_bg">
							<a href="#" class="close"><img src="<%=basePath %>/images/cross_grey_small.png" title="Close this notification" alt="close"></a>
							<%
								String code = request.getParameter("code");
								if("101".equals(code)){
							 %>
							 <div>
								操作失败，该商品不存在！
							</div>
							 <%}else if("100".equals(code)){%>
							<div>
								删除成功！
							</div>
							<%} %>
						</div>
						
						<table>
							
							<thead>
								<tr>
								   <th>商品名称</th>
								   <th>所属类别</th>
								   <th>编码</th>
								   <th>价格</th>
								   <th>颜色</th>
								   <th>操作</th>
								</tr>
								
							</thead>
						 
							<tfoot>
								<tr>
									<td cols pan="6">
										<!--
										<div class="bulk-actions align-left">
											<select name="dropdown">
												<option value="option1">Choose an action...</option>
												<option value="option2">Edit</option>
												<option value="option3">Delete</option>
											</select>
											<a class="button" href="#">Apply to selected</a>
										</div>
										-->
										<div class="pagination">
											<a href="main.jsp" title="First Page">« 首页</a><a href="#" title="Previous Page">« 上一页</a>
											<a href="#" title="Next Page">下一页 »</a><a href="#" title="Last Page">末页 »</a>
										</div> <!-- End .pagination -->
										<div class="clear"></div>
									</td>
								</tr>
							</tfoot>
						 
							<tbody>
								<%
									List<Product> list = (List<Product>)request.getAttribute("productlist");
									for(int i = 0;i<list.size();i++){
										Product p = list.get(i);
										if(i%2 == 0){
								 %>
								 <tr>
								 <%} else{%>
								 <tr class="alt-row">
								<%} %>
									<td><%=p.getProductname() %></td>
									<td><%=p.getType().getTypename()%></td>
									<td><%=p.getCode() %></td>
									<td><%=p.getPrice() %></td>
									<td><%=p.getColor() %></td>
									<td>
										<!-- Icons -->
										 <a href="l_to_updateproduct.jsp?id=<%=p.getId() %>" title="修改"><img src="<%=basePath %>/images/pencil.png" alt="Edit"></a>
										 <a href="javascript:reldel(<%=p.getId() %>)" title="删除" ><img src="<%=basePath %>/images/cross.png" alt="Delete"></a> 
									</td>
								<%} %>
								</tr>
							</tbody>
							
						</table>
						
					</div> <!-- End #tab1 -->
					
					<div style="display: none;" class="tab-content" id="tab2">
					
						<form action="http://demo.ponjoh.com/Simpla-Admin/index.html" method="post">
							
							<fieldset>
								
								<p>
									<label>Small form input</label>
										<input value="" class="text-input small-input" id="small-input" name="small-input" type="text"> <span class="input-notification success png_bg">Successful message</span> <!-- Classes for input-notification: success, error, information, attention -->
										<br><small>A small description of the field</small>
								</p>
								
								<p>
									<label>Medium form input</label>
									<input value="" class="text-input medium-input datepicker" id="medium-input" name="medium-input" type="text"> <span class="input-notification error png_bg">Error message</span>
								</p>
								
								<p>
									<label>Large form input</label>
									<input value="" class="text-input large-input" id="large-input" name="large-input" type="text">
								</p>
								
								<p>
									<label>Checkboxes</label>
									<input name="checkbox1" type="checkbox"> This is a checkbox <input name="checkbox2" type="checkbox"> And this is another checkbox
								</p>
								
								<p>
									<label>Radio buttons</label>
									<input name="radio1" type="radio"> This is a radio button<br>
									<input name="radio2" type="radio"> This is another radio button
								</p>
								
								<p>
									<label>This is a drop down list</label>              
									<select name="dropdown" class="small-input">
										<option value="option1">Option 1</option>
										<option value="option2">Option 2</option>
										<option value="option3">Option 3</option>
										<option value="option4">Option 4</option>
									</select> 
								</p>
								
								<p>
									<label>Textarea with WYSIWYG</label>
									<div class="wysiwyg" style="width: 653px;"><ul class="panel"><li><a class="bold"><!-- --></a></li><li><a class="italic"><!-- --></a></li><li class="separator"></li><li><a class="createLink"><!-- --></a></li><li><a class="insertImage"><!-- --></a></li><li class="separator"></li><li><a class="h1"><!-- --></a></li><li><a class="h2"><!-- --></a></li><li><a class="h3"><!-- --></a></li><li class="separator"></li><li><a class="increaseFontSize"><!-- --></a></li><li><a class="decreaseFontSize"><!-- --></a></li><li class="separator"></li><li><a class="removeFormat"><!-- --></a></li></ul><div style="clear: both;"><!-- --></div><iframe src="index_1.html" id="textareaIFrame" style="min-height: 250px; width: 645px;"></iframe></div><textarea style="display: none;" class="text-input textarea wysiwyg" id="textarea" name="textfield" cols="79" rows="15"></textarea>
								</p>
								
								<p>
									<input class="button" value="Submit" type="submit">
								</p>
								
							</fieldset>
							
							<div class="clear"></div><!-- End .clear -->
							
						</form>
						
					</div> <!-- End #tab2 -->        
					
				</div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
			
			<!-- End Notifications -->
			
			<div id="footer">
				<small> <!-- Remove this notice or replace it with whatever you want -->
						© Copyright 2011 达芙妮官方购物网 | Powered by <a href="http://www.kaishengit.com">idaphne</a> | <a href="#">Top</a>
				</small>
			</div><!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
	</div>
  

    <div id="facebox" style="display: none;">       <div class="popup">         <table>           <tbody>             <tr>               <td class="tl"></td><td class="b"></td><td class="tr"></td>             </tr>             <tr>               <td class="b"></td>               <td class="body">                 <div class="content">                 </div>                 <div class="footer">                   <a href="#" class="close">                     <img src="closelabel.gif" title="close" class="close_image">                   </a>                 </div>               </td>               <td class="b"></td>             </tr>             <tr>               <td class="bl"></td><td class="b"></td><td class="br"></td>             </tr>           </tbody>         </table>       </div>     </div></body>
</html>
